using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._ManageData
{
    /// <summary>
    /// <para>Append Data</para>
    /// <para>Appends features to an existing hosted feature layer.</para>
    /// <para>将要素追加到现有托管要素图层。</para>
    /// </summary>    
    [DisplayName("Append Data")]
    public class AppendData : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AppendData()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The hosted feature layer to which features will be appended.</para>
        /// <para>将追加要素的托管要素图层。</para>
        /// </param>
        /// <param name="_append_layer">
        /// <para>Append Layer</para>
        /// <para>The layer containing features to append to the input layer.</para>
        /// <para>包含要追加到输入图层的要素的图层。</para>
        /// </param>
        /// <param name="_append_method">
        /// <para>Append Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how fields from the Input Layer will be appended with values from the Append Layer.</para>
        ///   <bulletList>
        ///     <bullet_item>Append matching fields only—Input layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.</bullet_item><para/>
        ///     <bullet_item>Append matching fields and resolve differences—Input layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何将输入图层中的字段追加到追加图层中的值。</para>
        ///   <bulletList>
        ///     <bullet_item>仅追加匹配字段—仅当输入图层字段在追加图层中具有匹配字段时，才会追加输入图层字段。没有匹配项的字段将附加 null 值。</bullet_item><para/>
        ///     <bullet_item>追加匹配字段并解析差异 - 输入图层字段可以追加相同名称和不同类型的追加图层字段，也可以追加根据 Arcade 表达式计算的值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public AppendData(object _input_layer, object _append_layer, _append_method_value _append_method)
        {
            this._input_layer = _input_layer;
            this._append_layer = _append_layer;
            this._append_method = _append_method;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Append Data";

        public override string CallName => "geoanalytics.AppendData";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _append_layer, _append_method.GetGPValue(), _append_fields, _append_expressions, _append_result];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The hosted feature layer to which features will be appended.</para>
        /// <para>将追加要素的托管要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Append Layer</para>
        /// <para>The layer containing features to append to the input layer.</para>
        /// <para>包含要追加到输入图层的要素的图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _append_layer { get; set; }


        /// <summary>
        /// <para>Append Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how fields from the Input Layer will be appended with values from the Append Layer.</para>
        ///   <bulletList>
        ///     <bullet_item>Append matching fields only—Input layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.</bullet_item><para/>
        ///     <bullet_item>Append matching fields and resolve differences—Input layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何将输入图层中的字段追加到追加图层中的值。</para>
        ///   <bulletList>
        ///     <bullet_item>仅追加匹配字段—仅当输入图层字段在追加图层中具有匹配字段时，才会追加输入图层字段。没有匹配项的字段将附加 null 值。</bullet_item><para/>
        ///     <bullet_item>追加匹配字段并解析差异 - 输入图层字段可以追加相同名称和不同类型的追加图层字段，也可以追加根据 Arcade 表达式计算的值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _append_method_value _append_method { get; set; }

        public enum _append_method_value
        {
            /// <summary>
            /// <para>Append matching fields only</para>
            /// <para>Append matching fields only—Input layer fields will only be appended if they have a matching field in the append layer. Fields without a match will be appended with null values.</para>
            /// <para>仅追加匹配字段—仅当输入图层字段在追加图层中具有匹配字段时，才会追加输入图层字段。没有匹配项的字段将附加 null 值。</para>
            /// </summary>
            [Description("Append matching fields only")]
            [GPEnumValue("MATCHING_ONLY")]
            _MATCHING_ONLY,

            /// <summary>
            /// <para>Append matching fields and resolve differences</para>
            /// <para>Append matching fields and resolve differences—Input layer fields can be appended with append layer fields of the same name and different type, or with values calculated from Arcade expressions.</para>
            /// <para>追加匹配字段并解析差异 - 输入图层字段可以追加相同名称和不同类型的追加图层字段，也可以追加根据 Arcade 表达式计算的值。</para>
            /// </summary>
            [Description("Append matching fields and resolve differences")]
            [GPEnumValue("FIELD_MAPPING")]
            _FIELD_MAPPING,

        }

        /// <summary>
        /// <para>Append Fields</para>
        /// <para>The append layer fields of the same type and different name as the input layer fields to be appended. Select the Input Field you want to append to, and the Append Field containing the values you want to append.</para>
        /// <para>追加与要追加的输入图层字段类型相同、名称不同的图层字段。选择要追加到的输入字段和包含要追加的值的追加字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _append_fields { get; set; } = null;


        /// <summary>
        /// <para>Append Expressions</para>
        /// <para><xdoc>
        ///   <para>The Arcade expression used to calculate field values for the input field. Expressions are written in Arcade and can include mathematical operators and multiple fields.</para>
        ///   <para>Select the fields you want to append to, and enter an expression for each to calculate the values you want to append. If the layer is added to the map, the fields and helpers can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于计算输入字段的字段值的 Arcade 表达式。表达式是在 Arcade 中编写的，可以包括数学运算符和多个字段。</para>
        ///   <para>选择要追加到的字段，然后为每个字段输入表达式以计算要追加的值。如果将图层添加到地图中，则可以使用字段和帮助程序来构建表达式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Expressions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _append_expressions { get; set; } = null;


        /// <summary>
        /// <para>Append Result</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Append Result")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _append_result { get; set; }


        public AppendData SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}